package com.zx.job.service.Impl;

import Job.Dto.JobDto;
import Job.Dto.SalaryDto;
import com.zx.job.mapper.JobRepository;
import com.zx.job.service.JobService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
@RequiredArgsConstructor
public class JobServiceImpl implements JobService {
    private final JobRepository jobRepository;
    @Override
    public List<JobDto> findAll() {
        return jobRepository.findAll();
    }

    @Override
    public List<JobDto> findByCriteria(Integer categoryId, String city,
                                       Integer salaryL, Integer salaryR,
                                       String degree) {
        return jobRepository.findByCriteria(categoryId, city, salaryL, salaryR, degree);
    }

    @Override
    public List<SalaryDto> findAllSalary() {
        return jobRepository.findAllSalary();
    }

    @Override
    public void addJob(JobDto jobDto) {
        jobRepository.addJob(jobDto);
    }
}
